﻿//-----------------------------------------------------------------------
// <copyright file="IScheduleManager.cs" company="FastNET Services">
//     Copyright (c) 2007-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings
using System;
using FastNET.CleanAct.Client.Interfaces.EventArguments;

#endregion

namespace FastNET.CleanAct.Client.Interfaces.Managers
{
    /// <summary>
    /// Manager interface for schedule management
    /// </summary>
    public interface IScheduleManager : IThreadedManager
    {
        /// <summary>
        /// Event used when a schedule is ready to be run
        /// </summary>
        event EventHandler<ScheduleFiredEventArgs> ScheduleFired;

        /// <summary>
        /// Clears all schedules from the manager and all queued run times
        /// </summary>
        void ClearSchedules();

        /// <summary>
        /// Loads an iCalendar based schedule into the <see cref="IScheduleManager"/> to be managed
        /// </summary>
        /// <param name="scheduleID">ID for this schedule</param>
        /// <param name="scheduleContent">iCalendar based text for the schedule</param>
        void LoadSchedule(Guid scheduleID, string scheduleContent);

        /// <summary>
        /// Removes the specified schedule by ID from the manager and any associated queued run times
        /// </summary>
        /// <param name="scheduleID"></param>
        void UnloadSchedule(Guid scheduleID);
    }
}